addProp(description, #downNextCM, [#comment: "Down state of button: ", #format: #bitmap, #default: memdefault])
addProp(description, #disNextCM, [#comment: "Disabled state of button: ", #format: #bitmap, #default: disdefault])
addProp(description, #PrevButtonSprite, [#comment: "What channel is Previous Button: ", #format: #integer, #default: the currentSpriteNum - 1])
addProp(description, #totalCount, [#comment: "How many text fields: ", #format: #integer, #default: 1])
return description
end
on getBehaviorDescription
return "Send a Message to the designated Sprite when the specified Event occurs. At its destination the message will be interpreted as a sprite event and any actions defined for that event will be invoked." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Message - name of event to invoke at target sprite." & RETURN & "ΓÇó Target Sprite - number of sprite channel to which message should be sent." & RETURN & "ΓÇó Triggering Event - event that should cause message to be sent." & RETURN & "NOTES:" & RETURN & "If the target sprite does not handle the message it will propagate to the cast member script, the current frame script, and then the movie, in search of a handler for that event."
end
on getAssocMembers
set myPropList to [downNextCM, disNextCM]
return myPropList
end
on beginSprite me
set the upNextCM of me to the member of sprite the spriteNum of me
set the upNextNum of me to the number of member upNextCM
set the downNextNum of me to the number of member downNextCM
set the disNextNum of me to the number of member disNextCM
set the button_active of me to 0
set the currentCount of me to 1
end
on endSprite me
puppetSprite(the spriteNum of me, 0)
end
on triggerSendSprite me
trigger(me)
end
on checkbutton me
set currentCount to the currentCount of sprite(the TextSprite of me)
if currentCount = totalCount then
set the member of sprite the spriteNum of me to disNextNum
else
set the member of sprite the spriteNum of me to upNextNum
end if
end
on mouseUp me
if the number of member the member of sprite the spriteNum of me = disNextNum then
exit
end if
set the member of sprite the spriteNum of me to upNextNum
set the button_active of me to 0
if whichevent = #mouseUp then
trigger(me)
end if
end
on mouseDown me
if the number of member the member of sprite the spriteNum of me = disNextNum then
exit
end if
set the member of sprite the spriteNum of me to downNextNum
set the button_active of me to 1
if whichevent = #mouseDown then
trigger(me)
end if
end
on mouseUpOutSide me
if the number of member the member of sprite the spriteNum of me = disNextNum then
exit
end if
set the button_active of me to 0
end
on mouseLeave me
if the number of member the member of sprite the spriteNum of me = disNextNum then
exit
end if
if the button_active of me then
set the member of sprite the spriteNum of me to upNextNum
end if
end
on mouseEnter me
if the number of member the member of sprite the spriteNum of me = disNextNum then
exit
end if
if the button_active of me then
set the member of sprite the spriteNum of me to downNextNum